/**
 * 
 */
package com.feib.stms.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.feib.stms.model.MenuItem;
import com.feib.stms.pagination.PaginatedList;

/**
 * @author Jimmy Liu
 *
 */
@Transactional(readOnly = true)
public interface MenuItemService 
{

	public List<MenuItem> getAllEnabledMenuItemsWithRoles();
	
	/**
	 * 查詢所有券商可用的程式選單.
	 * @return
	 */
	public List<MenuItem> getAllEnabledMenuItemsForSecuritiesWithRoles();
	
	/** 根據pk查詢
	 * @param menuItemPk
	 * @return MenuItem
	 */
	public MenuItem getByMenuItemPk(Long menuItemPk);
	
	/** 分頁查詢系統功能設定菜單
	 * @param menuItem
	 * @param menuType
	 * @param paginatedList
	 * @return PaginatedList<MenuItem>
	 */
	public PaginatedList<MenuItem> findForPaginatedListByMenuItem(MenuItem menuItem ,String menuType, PaginatedList paginatedList);
	
	/** 上層程式下拉選單列表
	 * @return List<MenuItem>
	 */
	public List<MenuItem> initMenuItemOptionList();
	
	/** 新增系統功能設定
	 * @param menuItem
	 * @return int
	 */
	@Transactional(readOnly = false)
	public int saveMenuItem(MenuItem menuItem);
	
	/** 修改系統功能設定
	 * @param menuItem
	 * @return int
	 */
	@Transactional(readOnly = false)
	public int updateMenuItem(MenuItem menuItem);
	
	/** 刪除系統功能設定
	 * @param pk
	 * @return int
	 */
	@Transactional(readOnly = false)
	public int deleteMenuItem(Long pk);
	
	/** 獲取父menuItem數量
	 * @param pk
	 * @return int
	 */
	public int countParentMenuItem(Long pk);
}
